package com.bah.tract.client.ui;

import java.util.Date;

import javax.xml.datatype.XMLGregorianCalendar;

import com.bah.tract.service.Task;
import com.bah.tract.service.Work;

public class TimeCardRow {

	public TimeCardRow(final Work work, final Task task,
			final LabelService labelService) {
		project = labelService.getProjectLabel(work.getProjectId());
		start = work.getStart().toGregorianCalendar().getTime();
		final XMLGregorianCalendar xcal = work.getEnd();
		if (xcal != null) {
			end = xcal.toGregorianCalendar().getTime();
		}
		this.task = task.getLabel();
		comment = work.getComment();
		this.work = work;
	}

	private String comment;

	private Date end;

	private String project;

	private Date start;

	private String task;

	private Work work;

	public final Work getWork() {
		return work;
	}

	public final void setWork(final Work work) {
		this.work = work;
	}

	public final String getComment() {
		return comment;
	}

	public final Date getEnd() {
		return end;
	}

	public final String getProject() {
		return project;
	}

	public final Date getStart() {
		return start;
	}

	public final String getTask() {
		return task;
	}

	public final void setComment(final String comment) {
		this.comment = comment;
	}

	public final void setEnd(final Date end) {
		this.end = end;
	}

	public final void setProject(final String project) {
		this.project = project;
	}

	public final void setStart(final Date start) {
		this.start = start;
	}

	public final void setTask(final String task) {
		this.task = task;
	}
}
